home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: guy@auspex.com (Guy Harris)
-
- >In this case NFS is indeed the culprit; it breaks the 1003.1 behavior of
- >allowing an application to read() from a directory. This restriction is
- >arbitrary; the NFS protocol itself allows it.
-
- The NFS *protocol* may allow it; however, it may be a pain for some NFS
- server to *implement* it (not all NFS servers run on top of UNIX; some
- may run on top of OSes that make it a pain to get at the raw data in the
- directory).
-
- >In fact, when 1003.8 (POSIX Transparent File Access) sees the light of
- >publicationand legitimizes NFS under POSIX (so to speak), this restriction
- >will *have* to go away if one wishes to claim ones implementation conforms
- >to 1003.8. Strictly conforming applications don't try to read() directories
- >with the assumption that they're doing something equivalent to readdir(),
- >since the standard doesn't say they can; however, a strictly-conforming
- >application is allowed to read() a directory for any purpose.
-
- If 1003.8 refers to NFS at all, what will it say about the behavior of
- file systems mounted from non-POSIX-compliant NFS servers? I suspect
- it'll have to say "you're on your own there, bucko", in which case
- suppliers of those servers are free to reject attempts to read from
- directories with the NFS READ request (rather than the NFS READDIR
- request).
-
- Note also that a strictly-conforming application cannot, of course,
- assume that the data it reads from a directory will have any particular
- format, unless you either 1) use #ifdefs for the different directory
- formats on different file systems (and compensate for byte-order
- problems as well), 2) wire knowledge of certain formats into the
- application, or 3) make the application programmable enough that
- programs written under it have that knowledge wired into them.
-
- (I.e., I suspect the sum total of POSIX-system-programmer misery will be
- increased infinitesimally, if it's increased at all, by just saying Thou
- Shalt Not Try To "read()" From Directories, Lest Thou Get An Error From
- "read()".
-
- I also suspect that having NFS client implementations reject requests to
- "read()" from directories will result in more broken programs - e.g.,
- programs that don't use "opendir()", "readdir()", and company - being
- caught and, hopefully, fixed.)
-
-
- Volume-Number: Volume 31, Number 86
-
-